package com.eqdd.yiqidian.box.span;

import android.content.Context;
import android.graphics.Color;
import android.support.v7.widget.AppCompatMultiAutoCompleteTextView;
import android.text.SpannableString;
import android.text.Spanned;
import android.util.AttributeSet;

/**
 * @author吕志豪 .
 * @date 17-12-7  上午11:28.
 * Github :https://github.com/lvzhihao100
 * E-Mail：1030753080@qq.com
 * 简书 :http://www.jianshu.com/u/6e525b929aac
 */

public class TestAppCompatMultiAutoCompleteTextView extends AppCompatMultiAutoCompleteTextView {
    public TestAppCompatMultiAutoCompleteTextView(Context context) {
        super(context);
    }

    public TestAppCompatMultiAutoCompleteTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public TestAppCompatMultiAutoCompleteTextView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void replaceText(CharSequence text) {
        System.out.println("TestAppCompatMultiAutoCompleteTextView->replaceText");
        SpannableString sp = new SpannableString(text);
        sp.setSpan(new CircleSpan(Color.GREEN, 40)
                , 0, text.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        super.replaceText(sp);
    }
}
